package com.gomyb.result;

import lombok.Getter;

/**
 * @author <a href="mailto:HelloHeSir@gmail.com">Mr_He</a>
 */
@Getter
public class Result<T> {

    protected T data;

    protected String message;

    protected Integer code;

    private boolean success = false;

    public Result() {
    }

    public Result(boolean success,T data) {
        this.success = success;
        this.data = data;
    }

    public Result(String message) {
        this.message = message;
    }

    public Result(boolean success) {
        this.success = success;
    }

    public Result(T data) {
        this.data = data;
    }

    Result<T> setSuccess(boolean success) {
        this.success = success;
        return this;
    }
}